<%@page import="lib_model.Orther.ReturnObj"%>
<%@page import="lib_model.Transportion.Transportion_type"%>
<%@page import="lib_model.Factories.Factory"%>
<%@page import="lib_model.Account.Account_warehouse"%>
<%@page import="lib_model.Transportion.Transportion_bill"%>
<%@page import="lib_model.WareHouse.Warehouse"%>
<%@page import="lib_model.Product.Products"%>
<%@page import="lib_model.Account.Account_factory"%>
<%@page import="lib_model.Account.Account"%>
<%@page import="java.util.ArrayList"%>
<%@page import="lib_model.Factories.Stocks_factory"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<jsp:include page="../templates/Factories.jsp"></jsp:include>
Transportion Bill
<jsp:include page="../templates/Title.jsp"></jsp:include>
<jsp:include page="../templates/StyleFac.jsp"></jsp:include>
<div class="body-center w960">
<h2 class="title-show">Transportion Bill</h2>
<%
	Transportion_bill bills = new Transportion_bill();
	ReturnObj rs = bills.Select();
	ArrayList<Transportion_bill> arr = (ArrayList<Transportion_bill>) rs.ObjResult;
%>
<table class="tb">
	<thead>
		<tr>
			<th align="left" width="20%">Warehouse</th>
			<th align="left" width="20%">Account Warehouse</th>
			<th align="left" width="20%">Factories</th>
			<th align="left" width="20%">Acount Factories</th>
			<th align="left" width="20%">Transportion Type</th>
			<th align="left" width="20%">Details</th>
		</tr>
	</thead>
	<tbody>
		<%
			Account acc = (Account) request.getSession().getAttribute("User");
			String usn = acc.username;
			int fac_id = 0;
			fac_id = ((Account_factory) (new Account_factory(usn)
					.GetInformation().ObjResult)).factory_id_ref;
			for (Transportion_bill bill : arr) {
				if (bill.factory_id_ref == fac_id) {
		%>
		<tr>
			<td><%=((Warehouse) ((new Warehouse(
							bill.warehouse_id_ref)).GetInformation().ObjResult)).name%></td>
			<td><%=((Account_warehouse) ((new Account_warehouse(
							bill.account_warehouse_username_get_ref))
							.GetInformation().ObjResult)).username_ref%></td>
			<td><%=((Factory) ((new Factory(bill.factory_id_ref))
							.GetInformation().ObjResult)).name%></td>
			<td><%=((Account_factory) ((new Account_factory(
							bill.account_factory_username_ref))
							.GetInformation().ObjResult)).username_ref%></td>
			<td><%=((Transportion_type) ((new Transportion_type(
							bill.transportion_type_name_ref)).GetInformation().ObjResult)).name%></td>
			<td><a
				href='../factories/transportion-detail.jsp?id=<%=bill.id%>'>Details</a></td>
		</tr>
		<%
			}
			}
		%>
	</tbody>
</table>
</div>
<jsp:include page="../templates/Footer.jsp"></jsp:include>